package com.tanhua.model.vo;

import com.tanhua.model.db.Topic;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TopicVo {
    private String id;
    private String question;
    private List<OptionVo> options;

    public static TopicVo init(Topic topic) {
        TopicVo vo = new TopicVo();
        vo.setId(topic.getQuestionId().toString());
        vo.setQuestion(topic.getContent());
        return vo;
    }
}
